remotemanager.utils.flags module

class remotemanager.utils.flags.Flags(*initial_flags)[source]

Basic but flexible handler for terminal command flags

Allows for inplace modification:

>>> f = Flags("abcdd")
>>> f -= "d"
>>> f.flags
>>> "-abcd"
Parameters:

initial_flags (str) – initial base flags to be used and modified if needed

ensure_prefix_exists(prefix)[source]

Ensures that the prefix exists in the internal storage, creating it if not

parse_string(string) [<class 'str'>, <class 'bool'>][source]

Takes a string, and strips away any non-alphanumeric chars. Returns True in secondary return if this is a verbose flag

Parameters:

string (str) – input flags

Returns (str, bool):

filtered input True if this is a verbose flag

property flags

Returns the fully qualified flags as a string

remotemanager.utils.flags.strip_non_alphanumeric(string)[source]

remove any non-alphanumeric strings from input string

Parameters:

string (str) – input string

Returns (str):

input string, sans any non-alphanumeric chars